/**
 * Created by Fred(qq:24242811) on 2019/1/10.
 */
const Route = use('Route')
const Env = use('Env')

// 无需登录
Route.group(() => {
  Route.get('drive', 'DriveController.index')
  Route.post('code', 'DriveController.code')
  Route.post('create', 'DriveController.create')
  Route.get('address', 'AddressController.index')
  Route.get('addressCity', 'AddressController.addressCity')
  Route.get('addressByCityName', 'AddressController.addressByCityName')
  Route.get('addressListByCityName', 'AddressController.addressListByCityName')
  Route.get('news', 'NewsController.index')
  Route.get('news/:id', 'NewsController.show')
  Route.get('showPoster', 'SettingController.showPoster')
  Route.get('poster/:id', 'PosterController.poster')
  //////
  Route.post('sendSmsCode', 'UserController.sendSmsCode')
  Route.post('login', 'UserController.login')
  Route.get('getExhibitor', 'UserController.getExhibitor')
  Route.resource('product', 'ProductController')
  Route.resource('exhibitor', 'ExhibitorController')
  Route.resource('video', 'VideoController')
  Route.get('exhibitor2021', 'ExhibitorController.exhibitor2021')
  // Route.post('likeProduct', 'UserController.likeProduct')
  // Route.post('getUserSelf', 'UserController.getUserSelf')
  Route.post('receipt', 'UserController.receipt')
})

Route.group(() => {

  Route.get('authTest', 'UserController.authTest')
  Route.post('likeProduct', 'UserController.likeProduct')
  Route.post('likeNews', 'UserController.likeNews')
  Route.post('likeExhibitor', 'UserController.likeExhibitor')
  Route.get('getUserSelf', 'UserController.getUserSelf')
  
  Route.post('wantbuy', 'UserController.wantbuy')
  Route.get('getWantbuy', 'UserController.getWantbuy')
  
  Route.get('wantbuyList', 'UserController.wantbuyList')
  Route.get('likeProductList', 'UserController.likeProductList')
  Route.get('likeNewsList', 'UserController.likeNewsList')
  Route.get('likeExhibitorList', 'UserController.likeExhibitorList')
})
  .middleware(['userAuth'])
  // .prefix('drive/')
